//
//  SMFScanQRCodeMainView.h
//  SMFScanQRCode
//
//  Created by mac on 2022/9/19.
//

#import <UIKit/UIKit.h>
#import "SMFScanQRCodeViewStyle.h"
#import "SMFScanQRCodeView.h"
#import "SMFScanQRCodeNative.h"
#import "SMFScanQRCodeResult.h"

NS_ASSUME_NONNULL_BEGIN

@protocol SMFScanQRCodeMainViewDelegate <NSObject>

@optional

- (void)scanResultWithArray:(NSArray <SMFScanQRCodeResult *> *)array;

@end

@interface SMFScanQRCodeMainView : UIView<UIImagePickerControllerDelegate>


/**
 @brief  初始化
 @param color 四个边角的颜色
 @param animationImage 上下扫描的图片

 @return instancetype
 */
- (id)initWithFrame:(CGRect)frame colorAngle:(UIColor*)color animationImage:(UIImage *)animationImage;


/**
 @brief  初始化
 @param frame 位置大小
 @param style 类型

 @return instancetype
 */
- (id)initWithFrame:(CGRect)frame style:(SMFScanQRCodeViewStyle*)style;


@property (nonatomic, weak) id<SMFScanQRCodeMainViewDelegate> delegate;

/**
 相机启动提示,如 相机启动中...
 */
@property (nonatomic, copy) NSString *cameraInvokeMsg;

/**
 *  界面效果参数
 */
@property (nonatomic, strong) SMFScanQRCodeViewStyle *style;

#pragma mark -----  扫码使用的库对象 -------

/**
 @brief  扫码功能封装对象
 */
@property (nonatomic,strong) SMFScanQRCodeNative *scanObj;



#pragma mark - 扫码界面效果及提示等
/**
 @brief  扫码区域视图,二维码一般都是框
 */

@property (nonatomic,strong) SMFScanQRCodeView * qRScanView;

/**
 @brief  闪关灯开启状态记录
 */
@property(nonatomic,assign) BOOL isOpenFlash;

//开关闪光灯
- (void)openOrCloseFlash;

//开始扫描
- (void)startScan;

//关闭扫描
- (void)stopScan;

//使用图片扫描
- (void)startScanWithImage:(UIImage *)image;

@end

NS_ASSUME_NONNULL_END
